package com.jk.smartelderlycare.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jk.smartelderlycare.dto.SysPurchaseput;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface SysPurchaseputMapper extends BaseMapper<SysPurchaseput> {
    /**
     * @description: 关闭
     * @param: [purchasePutid]
     * @return: void
     * @author hhk
     * @date: 2024/12/5 20:55
     */
    @Update("update sys_purchaseput set  state = '已关闭' where purchase_putid = #{purchasePutid}")
    void ShutdownStatusById(Long purchasePutid);
    /**
     * @description: 未审核
     * @param: [purchasePutid]
     * @return: void
     * @author hhk
     * @date: 2024/12/5 20:57
     */
    @Update("update sys_purchaseput set state = '未审核' where purchase_putid = #{purchase_putId}")
    void downStatusById(Long purchasePutid);
    /**
     * @description: 审核
     * @param: [purchasePutid]
     * @return: void
     * @author hhk
     * @date: 2024/12/5 20:57
     */
    @Update("update sys_purchaseput set state = '审核' where purchase_putid = #{purchase_putId}")
    void upStatusById(Long purchasePutid);
    /**
     * @description: 后端分页
     * @param: [sysPurchaseput, page]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.jk.smartelderlycare.dto.SysPurchaseput>
     * @author hhk
     * @date: 2024/12/5 20:58
     */
    IPage<SysPurchaseput> findSysPurchaseputPaginationList(@Param(value = "sysPurchaseput") SysPurchaseput sysPurchaseput, Page<SysPurchaseput> page);
    /**
     * @description: 删除
     * @param: [purchasePutid]
     * @return: void
     * @author hhk
     * @date: 2024/12/5 21:01
     */
    @Delete("delete from sys_purchaseput_supplier where purchase_putid =#{purchase_putId}")
    void deleteSysPurchaseputById(Long purchasePutid);
}